<template>
  <div id="J_prismPlayer"></div>
</template>

<script>
export default {
  name: "videoplay",
  data() {
    return {
      player: null
    };
  },
  props: ["PlayAuth", "VideoId", "CoverURL"],
  mounted() {
    this.play(this.PlayAuth, this.VideoId, this.CoverURL);
  },
  methods: {
    play(PlayAuth, CoverURL, VideoId) {
      this.player = new window.Aliplayer({
        id: "J_prismPlayer",
        autoplay: true,
        isLive: false,
        cover: CoverURL,
        rePlay: true,
        useH5Prism: true,
        useFlashPrism: false,
        x5_video_position: "normal",
        x5_type: "h5",
        playauth: PlayAuth,
        vid: VideoId,
        height: "281.25px",
        width: "100%",
        encryptType: 0,
        format: "mp4"
      });
    }
  },
  beforeDestroy() {
    this.player.pause();
  }
};
</script>
